Exception Handling


In [ ]:


In [ ]:


In [ ]:


In [ ]:
try:
    age = int(input('How old are you?'))
    life_stage = 'Adult' if age > 18 else 'Child'
    print("Your life stage is:", life_stage)
except:
    print("You didn't enter a valid age")

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]: